<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Setting extends Model
{
    use HasFactory;

    public $timestamps = false;

    protected $fillable = [
        'website_name',
        'map_key',
        'share_ratio',
        'low_red_money',
        'open_send',
        'open_attention',
        'hint_attention',
        'sensitive_word',
        'notice',
        'notice_time',
        'coupon_check'
    ];

    /**
     * 公众号配置
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function wechat()
    {
        return $this->hasOne('App\Models\SettingWechat');
    }

    /**
     * 支付商户配置
     */
    public function pay()
    {
        return $this->hasOne('App\Models\SettingPay');
    }

    /**
     * 财务相关配置
     */
    public function finance()
    {
        return $this->hasOne('App\Models\SettingFinance');
    }

    /**
     * 系统收益配置
     */
    public function gain()
    {
        return $this->hasOne('App\Models\SettingGain');
    }

    /**
     *素材库配置
     */
    public function media()
    {
        return $this->hasOne('App\Models\SettingMedia');
    }

    /**
     * 消息配置
     */
    public function message()
    {
        return $this->hasOne('App\Models\SettingMessage');
    }
}
